# 请在此输入您的代码
n = int(input())
weights = list(map(int, input().split()))
dp = set()
for weight in weights:
    new = set()
    for b in dp:
        new.add(b + weight)
        new.add(b - weight)
    dp.add(-weight)
    dp.add(weight)
    dp = dp.union(new)
print(sum(1 for x in dp if x > 0))
